Skip to main content

Recognition result specification (XML)

RecognitionResult

Root element of the recognition result

propertytypewritten asrequireddescription
resultSchemaVersionstringattributeRecognition result schema version in major.minor.patch format, where major, minor, patch are non-negative integers.
dataFieldResultsDataFieldResultmultiple elementsList of data fields results.

RecognitionResult xml example

Click to expand xml
<?xml version="1.0" encoding="UTF-8"?>
<results resultSchemaVersion="1.0.0">
<dataFieldResult ...>
....
</dataFieldResult>
....
<dataFieldResult ...>
....
</dataFieldResult>
</results>

DataFieldResult

propertytypewritten asrequireddescription
namestringattributeThe name of the data field.
dataTypestringattributeThe type of data field as it is specified in template.
resultsResultValuemultiple elementsThe list of recognition results which can be one of several types: TEXT, IMAGE, TABLE, GROUP.

DataFieldResult xml example

Click to expand xml
<dataFieldResult name="M1" dataType="root">
<result ...>
...
</result>
...
<result ...>
...
</result>
</dataFieldResult>

ResultValue

TextResult

propertytypewritten asrequireddescription
resultTypestringattributeThe type of value result. Always TEXT.
contentstringsingle elementExtracted text data.
pageLocationMetaPageLocationMetasingle elementDescribes the location of the result within the PDF file.
fontMetaFontMetasingle elementContains information about font of the result content.

TextResult xml without meta example

Click to expand xml
<result resultType="TEXT">
<content>st nd</content>
</result>

TextResult xml with meta example

Click to expand xml
<result resultType="TEXT">
<pageLocationMeta .../>
<fontMeta .../>
<content>st nd</content>
</result>

ImageResult

propertytypewritten asrequireddescription
resultTypestringattributeThe type of value result. Always IMAGE.
base64stringsingle elementRepresentation of the extracted image bytes as base64 string.
pageLocationMetaPageLocationMetasingle elementDescribes the location of the result within the PDF file.

ImageResult xml without meta example

Click to expand xml
<result resultType="IMAGE">
<base64>abcdefghijk</base64>
</result>

ImageResult xml with meta example

Click to expand xml

<result resultType="IMAGE">
<pageLocationMeta .../>
<base64>abcdefghijk</base64>
</result>

TableResult

propertytypewritten asrequireddescription
resultTypestringattributeThe type of value result. Always TABLE.
rowsTableRowResultmultiple elementsThe list of table row results.
pageLocationMetasPageLocationMetamultiple elementsDescribes the locations of the result within the PDF file, will contain multiple values in case the table takes up several pages.

TableResult without meta xml example

Click to expand xml

<result resultType="TABLE">
<result resultType="TABLE_ROW">
...
</result>
...
<result resultType="TABLE_ROW">
...
</result>
</result>

TableResult with meta xml example

Click to expand xml
<result resultType="TABLE">
<pageLocationMeta .../>
...
<pageLocationMeta ../>
<result resultType="TABLE_ROW">
...
</result>
...
<result resultType="TABLE_ROW">
...
</result>
</result>

TableRowResult

propertytypewritten asrequireddescription
resultTypestringattributeThe type of value result. Always TABLE_ROW.
cellsTableCellResultmultiple elementsThe list of table cells in the row.
pageLocationMetaPageLocationMetasingle elementDescribes the location of the result within the PDF file.

TableRowResult xml without meta example

Click to expand xml
<result resultType="TABLE_ROW">
<result resultType="TABLE_CELL" ...>
...
</result>
...
<result resultType="TABLE_CELL" ...>
...
</result>
</result>

TableRowResult xml with meta example

Click to expand xml
<result resultType="TABLE_ROW">
<pageLocationMeta .../>
<result resultType="TABLE_CELL" ...>
...
</result>
...
<result resultType="TABLE_CELL" ...>
...
</result>
</result>

TableCellResult

propertytypewritten asrequireddescription
resultTypestringattributeThe type of value result. Always TABLE_CELL.
contentstringsingle elementText data extracted from the cell.
pageLocationMetaPageLocationMetasingle elementDescribes the location of the result within the PDF file.
fontMetaFontMetasingle elementContains information about font of the result content.
rowspanintattributeSpecifies the number of rows a cell should span.
colspanintattributeSpecifies the number of columns a cell should span.

TableCellResult without meta xml example

Click to expand xml
<result resultType="TABLE_CELL" rowspan="2" colspan="2">
<content>Key</content>
</result>

TableCellResult with meta xml example

Click to expand xml
<result resultType="TABLE_CELL" rowspan="2" colspan="2">
<pageLocationMeta .../>
<fontMeta .../>
<content>Key</content>
</result>

GroupResult

propertytypewritten asrequireddescription
resultTypestringattributeThe type of value result. Always GROUP.
entriesGroupEntryResultmultiple elementsList of grouped result entries.

GroupResult xml example

Click to expand xml
<result resultType="GROUP">
<result resultType="GROUP_ENTRY" ...>
...
</result>
...
<result resultType="GROUP_ENTRY" ...>
...
</result>
</result>

GroupEntryResult

propertytypewritten asrequireddescription
resultTypestringattributeThe type of value result. Always GROUP_ENTRY.
namestringattributeThe group entry name
dataTypestringattributeThe type of the group entry data
resultsResultValuemultiple elementsThe list of recognition results which can be one of several types: TEXT, IMAGE, TABLE, GROUP.

GroupEntryResult xml example

Click to expand xml
<result name="GroupEntry" dataType="dataType" resultType="GROUP_ENTRY">
<result ...>
...
</result>
...
<result ...>
...
</result>
</result>

Meta

PageLocationMeta

propertytypewritten asrequireddescription
xdoubleattributeThe x coordinate on the page.
ydoubleattributeThe y coordinate on the page.
widthdoubleattributeThe width of the location.
heightdoubleattributeThe height of the location.
pageintattributeThe page number.

PageLocationMeta xml example

Click to expand xml
<pageLocationMeta x="176.8" y="543.52" width="34.1" height="6.42" page="2"/>

FontMeta

propertytypewritten asrequireddescription
fontNamestringattributeThe font name.
fontStylestringattributeThe font style. Possible values: NORMAL, BOLD, ITALIC, BOLD_ITALIC.
fontColorString (rgb format)attributeThe font color. The format is #rrggbb , where rr, gg, bb are hex representations of corresponding color value.

FontMeta xml example

Click to expand xml
<fontMeta fontName="TimesNewRomanPSMT" fontStyle="NORMAL" fontColor="#000000"/>

Complete example

RecognitionResult without meta xml example

Click to expand xml
<?xml version="1.0" encoding="UTF-8"?>
<results resultSchemaVersion="1.0.0">
<dataFieldResult name="M1" dataType="root1">
<result resultType="TEXT">
<content>st nd</content>
</result>
</dataFieldResult>
<dataFieldResult name="M2" dataType="root2">
<result resultType="IMAGE">
<base64>abcdefghijk</base64>
</result>
</dataFieldResult>
<dataFieldResult name="M3" dataType="root3">
<result resultType="TABLE">
<result resultType="TABLE_ROW">
<result resultType="TABLE_CELL">
<content>Key</content>
</result>
<result resultType="TABLE_CELL" rowspan="2" colspan="2">
<content>Key</content>
</result>
</result>
</result>
</dataFieldResult>
<dataFieldResult name="M4" dataType="root4">
<result resultType="GROUP">
<result name="GroupEntry" dataType="dataType" resultType="GROUP_ENTRY">
<result resultType="TEXT">
<content>Group Text</content>
</result>
</result>
</result>
</dataFieldResult>
</results>

RecognitionResult with xml example

Click to expand xml
<?xml version="1.0" encoding="UTF-8"?>
<results resultSchemaVersion="1.0.0">
<dataFieldResult name="M1" dataType="root1">
<result resultType="TEXT">
<pageLocationMeta x="176.8" y="543.52" width="34.1" height="6.42" page="2"/>
<fontMeta fontName="TimesNewRomanPSMT" fontStyle="NORMAL" fontColor="000000"/>
<content>st nd</content>
</result>
</dataFieldResult>
<dataFieldResult name="M2" dataType="root2">
<result resultType="IMAGE">
<pageLocationMeta x="160.8" y="400.31" width="20.1" height="7.42" page="2"/>
<base64>abcdefghijk</base64>
</result>
</dataFieldResult>
<dataFieldResult name="M3" dataType="root3">
<result resultType="TABLE">
<pageLocationMeta x="176.8" y="543.52" width="34.1" height="6.42" page="2"/>
<result resultType="TABLE_ROW">
<pageLocationMeta x="176.8" y="543.52" width="34.1" height="6.42" page="2"/>
<result resultType="TABLE_CELL">
<pageLocationMeta x="176.8" y="543.52" width="34.1" height="6.42" page="2"/>
<fontMeta fontName="TimesNewRomanPSMT" fontStyle="NORMAL" fontColor="000000"/>
<content>Key</content>
</result>
<result resultType="TABLE_CELL" rowspan="2" colspan="2">
<pageLocationMeta x="176.8" y="350.9" width="34.1" height="6.42" page="2"/>
<fontMeta fontName="TimesNewRomanPSMT" fontStyle="NORMAL" fontColor="000000"/>
<content>Key</content>
</result>
</result>
</result>
</dataFieldResult>
<dataFieldResult name="M4" dataType="root4">
<result resultType="GROUP">
<result name="GroupEntry" dataType="dataType" resultType="GROUP_ENTRY">
<result resultType="TEXT">
<pageLocationMeta x="176.8" y="543.52" width="34.1" height="6.42" page="2"/>
<fontMeta fontName="TimesNewRomanPSMT" fontStyle="NORMAL" fontColor="000000"/>
<content>Group Text</content>
</result>
</result>
</result>
</dataFieldResult>
</results>